<template>
  <div id="demo1">
    123
  </div>
</template>
<script>
export default {
  name: "demo1",
  data: () => ({

  }),
  methods: {
    init () {
      let obj = {
        name: 'defore',
        age: 24,
        sex: 'male',
      }
      let arr = ['defore', 24, 'male']
      function speak() {
        console.log(arguments);
        for (var i in arguments) {
          console.log(i + " : " + arguments[i])
        }
      }
      // speak(...obj)
      //

      // speak(...arr)
      // 0 : defore
      // 1 : 24
      // 2 : male

      // speak(arr) // 0 : defore,24,male
    }
  },
  created() {
    //do something after creating vue instance
    this.init()
  }
}
</script>
<style lang="scss" scoped>
</style>
